import cookielib
import urllib2
import MySQLdb

def create_browser():
	cj=cookielib.CookieJar()
	cj.clear()
	CHandler = urllib2.HTTPCookieProcessor(cj)
	browser = urllib2.build_opener(CHandler)
	browser.addheaders = [('User-agent', 'Mozilla/5.0')]
	urllib2.install_opener(browser)
	return browser

def create_mysql():
	return MySQLdb.connect(host="127.0.0.1",
							port=3306,
							user="root",
							passwd="root",
							db="linkdb"
							)